package com.zy.serivice.impl;

import com.zy.bean.TPermissionMenuExample;
import com.zy.mapper.TPermissionMenuMapper;
import com.zy.service.TPermissionMenuService;
import com.zy.util.Datas;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: zy 690748807@qq.com
 * @Description: TODO
 * @Date: 2024/1/20 21:19
 * @Version: 1.0
 * @name 方法名字：
 */
@Service
public class TPermissionMenuServiceImpl implements TPermissionMenuService {
    @Autowired
    TPermissionMenuMapper tPermissionMenuMapper;
    @Override
    public Integer savePermissionToMenu(Integer[] perIds ,Integer menuId ) {
      int i=tPermissionMenuMapper.savePermissionToMenu(perIds,menuId);
//        int i=0;
//        for (Integer perId : perIds) {
//            TPermissionMenuExample tPermissionMenuExample = new TPermissionMenuExample();
//            tPermissionMenuExample.createCriteria().andMenuidEqualTo(menuId);
//            tPermissionMenuExample.createCriteria().andPermissionidEqualTo(perId);
//           i = tPermissionMenuMapper.insert(tPermissionMenuExample);
//        }
        return i;


    }
}
